package com.naire.modul.projeckpi.service;

import net.common.service.GeneralService;
import com.naire.modul.projeckpi.dao.ProjeckpiDao;
import com.naire.modul.projeckpi.dao.impl.ProjeckpiDaoImpl;
import com.naire.modul.projeckpi.vo.ProjeckpiVo;

/**
 * 
 * 
 * @author Administrator
 * 
 */
public class ProjeckpiDeleteService extends GeneralService {

	private ProjeckpiVo bean;

	@Override
	public void execute() throws Exception {
		ProjeckpiDao dao = new ProjeckpiDaoImpl();
		ProjeckpiVo v = dao.find(bean.getProject_kpi_id());
		if(v.getDisable() == 1) {
			bean.setDisable(0);
		} else {
			bean.setDisable(1);
		}
		dao.updateFlag(bean);
	}

	public void setBean(ProjeckpiVo bean) {
		this.bean = bean;
	}
}